<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="error_Page.jsp" %>

<%!
	String SID,StudentName,Password,Father_Name,DOB,Nationality,Address,City,Country,Phone,Mobile,NIC,Email;
	String sid,sname;
	Connection conn=null;
	Statement stmt=null;
	ResultSet rs=null;	
%>

 <% 
String sid=(String)session.getAttribute("id");
String sname=(String)session.getAttribute("name");
	if(sid==null)
	response.sendRedirect("http://localhost:8080/expired.html");
	else
try{
    SID=request.getParameter("T1");
    StudentName=request.getParameter("T2");
    Password=request.getParameter("T3");
    Father_Name=request.getParameter("T4");
    DOB=request.getParameter("T5");
    Nationality=request.getParameter("T6");
    Address=request.getParameter("T7");
    City=request.getParameter("T8");
    Country=request.getParameter("T9");
    Phone=request.getParameter("T10");
    Mobile=request.getParameter("T11");
    NIC=request.getParameter("T12");
    Email=request.getParameter("T13");
	out.println(Email);

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn=DriverManager.getConnection("jdbc:odbc:sis");
Statement st=conn.createStatement();

int chk=stmt.executeUpdate("UPDATE Student SET Email='"Email"' WHERE SID='"+SID+"'");
if(chk==1)
out.println("Updated Record Successfully!");

/*String Query="UPDATE Student SET SID='"+SID+"',SName='"+StudentName+"',Password='"+Father_Name+"',DOB='"+DOB+"',Nationality='"+Nationality+"',Address='"+Address+"',City='"+City+"',Country='"+Country+"',Phone='"+Phone+"',Mobile='"+Mobile+"',NIC='"+NIC+"',Email='"+Email+"' WHERE SID='"+SID+"'";

int chk=stmt.executeUpdate(Query);

if(chk==1)
out.println("Updated Record Successfully!");
else
out.println("Errors Occured During Updating Record ");
*/
}
catch(Exception e){
	out.println("Exception had been occured -- >  "+e.getMessage());
	out.println(e);
}
 %>
<html>
<head>
<title>Updating Student Record</title>
</head>
<body>

</body>
</html>
